﻿
using System;
using Dora.Services.AdminUser.Entities;
using SqlSugar;
using System.Threading.Tasks;
using Dora.Orm.SqlSugarCore.UnitOfWork;
using Surging.Core.Common;
using Surging.Core.CPlatform.Ioc;
using System.Collections.Generic;
using Dora.Services.AdminUser.Dto.ViewDto;

namespace Dora.Services.AdminUser.Repository.Repositorys
{

    /// <summary>
    /// 美程用户登录日志表仓储层
    /// </summary>
    //public class UserLoginLogRepository : SqlSugarRepository<UserLoginLogEntity, Guid>
    //{
    //    private ISugarUnitOfWork _unitOfWork;
    //    public UserLoginLogRepository(ISugarUnitOfWork unitOfWork) : base(unitOfWork)
    //    {
    //        _unitOfWork = unitOfWork;
    //    }

    //    / <summary>
    //    / 创建登录相关操作日志
    //    / </summary>
    //    / <param name = "input" ></ param >
    //    / < returns ></ returns >
    //    public async Task<int> Create(UserLoginLogEntity input)
    //    {
    //        if (input == null)
    //        {
    //            return 0;
    //        }
    //        input.CreatedTime = DateTime.Now;
    //        input.LoginDate = input.CreatedTime;
    //        var result = await _unitOfWork.ModifyClient.Insertable(input)
    //            .IgnoreColumns(it => new { it.CreatedTime })
    //            .ExecuteCommandAsync();
    //        return result;
    //    }

        ///// <summary>
        ///// 分页获取数据
        ///// </summary>
        ///// <param name="input"></param>
        ///// <returns></returns>
        //public async Task<PageDataList<DoraUserLoginLogEntity>> GetPageList(DoraUserLoginLogQueryDto input)
        //{
        //    var totalCount = 0;
        //    var pageList = _unitOfWork.QueryClient.Queryable<DoraUserLoginLogEntity>()
        //        .Where(p => p.IsDeleted == 0)
        //        .OrderBy(it => it.Id, OrderByType.Desc)
        //        .ToPageList(input.PageIndex, input.PageSize, ref totalCount);
        //    var page = new PageDataList<DoraUserLoginLogEntity>(pageList)
        //    {
        //        TotalCount = totalCount
        //    };
        //    return page;
        //}
   // }
}
